import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'

// 导入插件
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import mitt from 'mitt'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

import App from './App.vue'
import router from './router'

const app = createApp(App)

// vue3挂载到全局
app.config.globalProperties.$mitt = mitt();

// 创建pinia，别创建多个了，看清楚昂
const pinia = createPinia()

// 使用pinia插件，插件是加在pinia实例上的而不是app，注意注意
pinia.use(piniaPluginPersistedstate)

app.use(pinia)//这步不能忘哇
app.use(router)

app.use(ElementPlus)
app.mount('#app')
